package filetest.test01;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Test05 {
    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个文件名");
        while (true){

            String name = scanner.next();
            File file = new File("./"+name);
            if (file.exists()){
                System.out.println("文件名已存在,请重新输入");
                //name = scanner.next();
                //file = new File("./"+name);
            }
            else {
                file.mkdirs();
                System.out.println("文件创建成功");
                break;
            }
        }




    }
}
